<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.net.cluster.tina.ProtocolReader</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.net.cluster.tina.ProtocolReader";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html" class="symbol">tango.net.cluster.tina.ProtocolReader</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>July 2004: Initial release
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">class <a class="symbol _class" name="ProtocolReader" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L45" kind="class" beg="45" end="156">ProtocolReader</a> : Reader; <a title="Permalink to this symbol" href="#ProtocolReader" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L45">#</a></dt>
<dd class="ddef">
<div class="summary">Objects passed around a cluster are prefixed with a header, so the 
        receiver can pick them apart correctly. This header consists of:
        <pre class="d_code">
<span class="i">the</span> <span class="i">packet</span> <span class="i">size</span>, <span class="i">including</span> <span class="i">the</span> <span class="i">header</span> (<span class="n">16</span> <span class="i">bits</span>)
<span class="i">a</span> <span class="i">command</span> <span class="i">code</span> (<span class="n">8</span> <span class="i">bits</span>)
<span class="i">a</span> <span class="k">version</span> <span class="i">id</span> (<span class="n">8</span> <span class="i">bits</span>)
<span class="i">a</span> <span class="i">timestamp</span> (<span class="n">64</span> <span class="i">bits</span>)
<span class="i">length</span> <span class="i">of</span> <span class="i">the</span> <span class="i">channel</span> <span class="i">name</span> (<span class="n">32</span> <span class="i">bits</span>)
<span class="i">the</span> <span class="i">channel</span> <span class="i">name</span>
<span class="i">length</span> <span class="i">of</span> <span class="i">the</span> <span class="i">key</span> (<span class="n">32</span> <span class="i">bits</span>)
<span class="i">the</span> <span class="i">key</span>
<span class="i">an</span> <span class="i">optional</span> <span class="i">payload</span> (<span class="i">an</span> <span class="i">IMessage</span> <span class="i">instance</span>)
</pre></div>
Everything is written in Network order (big endian).
<dl>
<dt class="decl"><a class="symbol _ctor" name="ProtocolReader.this" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L60" kind="ctor" beg="60" end="63">this</a><span class="params">(IBuffer <em>buffer</em>)</span>; <a title="Permalink to this symbol" href="#ProtocolReader.this" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L60">#</a></dt>
<dd class="ddef">
<div class="summary">Construct a ProtocolReader upon the given buffer. As
                Objects are serialized their content is written to this
                buffer. The buffer content is then typically flushed to 
                some external conduit, such as a file or socket.</div>
Note that arrays (such as text) are *always* sliced from
                the buffer -- there's no heap activity involved. Thus it
                may be necessary to .dup content where appropriate</dd>
<dt class="decl">IMessage <a class="symbol _function" name="ProtocolReader.thaw" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L72" kind="function" beg="72" end="75">thaw</a><span class="params">(IMessage <em>host</em> = null)</span>; <a title="Permalink to this symbol" href="#ProtocolReader.thaw" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L72">#</a></dt>
<dd class="ddef">
<div class="summary">deserialize a payload into a provided host, or via
                the registered instance of the incoming payload</div></dd>
<dt class="decl">IMessage <a class="symbol _function" name="ProtocolReader.thaw:2" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L84" kind="function" beg="84" end="87">thaw</a><span class="params">(NetworkRegistry <em>registry</em>, IMessage <em>host</em> = null)</span>; <a title="Permalink to this symbol" href="#ProtocolReader.thaw:2" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L84">#</a></dt>
<dd class="ddef">
<div class="summary">deserialize a payload into a provided host, or via
                the registered instance of the incoming payload</div></dd>
<dt class="decl">bool <a class="symbol _function" name="ProtocolReader.getHeader" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L96" kind="function" beg="96" end="114">getHeader</a><span class="params">(inout ubyte <em>cmd</em>, inout char[] <em>channel</em>, inout char[] <em>element</em>)</span>; <a title="Permalink to this symbol" href="#ProtocolReader.getHeader" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L96">#</a></dt>
<dd class="ddef">
<div class="summary">Read the protocol header and return true if there's a 
                payload available</div></dd>
<dt class="decl">ClusterContent <a class="symbol _function" name="ProtocolReader.getPacket" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L127" kind="function" beg="127" end="155">getPacket</a><span class="params">(inout ubyte <em>cmd</em>, inout char[] <em>channel</em>, inout char[] <em>element</em>, inout long <em>time</em>)</span>; <a title="Permalink to this symbol" href="#ProtocolReader.getPacket" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.net.cluster.tina.ProtocolReader.html#L127">#</a></dt>
<dd class="ddef">
<div class="summary">Return an aliased slice of the buffer representing the 
                recieved payload. This is a bit of a hack, but eliminates
                a reasonable amount of overhead. Note that the channel/key
                text is retained right at the start of the returned content, 
                enabling the host to toss the whole thing back without any 
                further munging.</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2004 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:03:55 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>